#ifndef __BSP_USART_H__
#define __BSP_USART_H__

#include <bsp_common.h>

#define DEBUG_USARTx USART1

enum {
    USART1_INDEX = 0,
    USART2_INDEX,
    USART3_INDEX
};

typedef struct {
    UART_HandleTypeDef huart;
    uint8_t rxTmp[1];
    uint32_t recFlag;
    uint32_t recBufSize;
    uint8_t* buf;
} UartHandle;

/* 定义变量 --------------------------------------------------------------------*/

/* 函数申明 ------------------------------------------------------------------*/
void UART_Init(uint8_t index, uint32_t baud, uint32_t recLen);

UartHandle* GetUartHandle(uint8_t index);

#endif /* __BSP_USART_H__ */
